package com.ruoyi.client.domain.vo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.ruoyi.client.domain.entity.BlogComment;
import com.ruoyi.client.domain.entity.BlogUser;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;

import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@AutoMapper(target= BlogComment.class,reverseConvertGenerate = true)
public class CommentVo {
    /**
     * 数据库id
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;
    /**
     * mongodb id
     */
    @Id
    @TableField(exist = false)
    private ObjectId _id;
    /**
     * 关联id
     */
    private Long relateId;

    /**
     * 创建人
     */
    private Long userId;
    private BlogUser user;

    /**
     * 文章id
     */
    private Long targetId;
    /**
     * 评论对象json
     */
    private String targetJson;

    /**
     * 父id
     */
    private Long parentId;

    /**
     * 内容
     */
    private String content;

    /**
     * 层级
     */
    private Integer level;

    /**
     * 点赞数
     */
    private Integer likeNum;

    /**
     * 不喜欢数
     */
    private Integer dislikeNum;
    /**
     * 当前用户是否点赞
     */
    private String currentUserIsLike;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updateTime;
}
